#include "SpeedRunProcessor.h"
#include "MainLayer.h"
#include "PlayerPlane.h"
#include "SpeedRunBuff.h"
#include "InputLayer.h"


SpeedRunProcessor::SpeedRunProcessor(void)
{
	_time = 0;
}


SpeedRunProcessor::~SpeedRunProcessor(void)
{
}

void SpeedRunProcessor::process( PlayerPlane* plane, MainLayer* mainLayer )
{
	SpeedRunBuff* buff = SpeedRunBuff::create();
	buff->setTimeMax(_time);
	buff->setPlane(plane);
	buff->setId(getId());
	
	mainLayer->getInputLayer()->getStateBar()->addBuff(buff);
}

void SpeedRunProcessor::parseXml( xml_node node )
{
	float time = node.child("Time").text().as_float();
	_time = time;
}
